Conversation
| end | ||
|
|
||
| function Base.showerror(io::IO, e::PyError) | ||
| println(io, "PyError:\n", pystr_nofail(e.val)) |
There was a problem hiding this comment.
This line is crucial. e.val is the python exception object. And the question is how should we print it. Master does it calling repr. From looking at some tutorials, it seems that calling str is preferred. But I am by no means sure if it is the best analog of showerror in python. Or if it even depends on the python version, what's the preferred thing.
jw3126
left a comment
There was a problem hiding this comment.
The code is a bit quick and dirty and there are no tests. I would like to have some feedback about how errors should look like and if this is the right approach, before I clean it up.
|
Is there interest in this PR? |
|
@stevengj can you briefly comment if there is interest in this PR? So I know if I should polish / redesign / abandon it. |
On master the following snippet:
gives
This is hard to read. See also #843 . With this PR it becomes: